Stops the session by abandoning all activities in the session.
Parent Type: StoredLearningSession
Namespace: Microsoft.LearningComponents.Storage
Assembly: Microsoft.LearningComponents.Storage.dll
| C# |
|
public override void Abandon () |
| Exception type | Condition |
| InvalidOperationException | Thrown if the session is not in a state in which the attempt can be abandoned. Use IsAbandonValid to predict if the operation will succeed. |
The AttemptStatus must be Active in order to suspend a session in Execute view. It is not valid to suspend a session in other views.
This method does not save changes that result from abandoning the session. The application should call CommitChanges after this method and prior to disposing the object to ensure changes are persisted.
PostCondition rules are not run after abandoning the session. Any current value of NavigationRequest.ExitMode value of LearningDataModel.NavigationRequest will be ignored.
A session that has been abandoned cannot be resumed at a later time.
This method will read the activity tree associated with the session from LearningStore, if has not already been loaded.